library(haven)
birth_hist <- read_dta("~/Dropbox/Dissertation/Chapter 3/birth_hist.dta")
birth_hist <- read_dta("~/Dropbox/Dissertation/Chapter 3/Spring 2021/birth_hist.dta")
birth_hist <- read_dta("~/Dropbox/Dissertation/Chapter 3/Spring 2021/pre-trends/birth_hist.dta")
library(dplyr)
library(tidyr)
df <- birth_hist %>%
group_by(pre_trt_yr,w2_abshusband_dummy) %>%
summarize(avg.children = mean(BHED))
df$w2_abshusband_dummy <- as.factor(df$w2_abshusband_dummy)
levels(df$w2_abshusband_dummy) <- c("Co-resident","Migrant in Wave 2")
colnames(df)[2] <- "Husband_Status"
library(ggplot2)
p<-ggplot(df, aes(x=pre_trt_yr, y=avg.children, group=Husband_Status)) +
geom_line(aes(color=Husband_Status))+
geom_point(aes(color=Husband_Status))
p + scale_color_brewer(palette="Paired")+
theme_minimal() +
labs(title="Pre-treatment trends (no. of children borne by women)",x="No. of years pre-treatment", y = "Avg. No. of Children")
